/**
 * 
 */
package web.common.dao.impl;

import java.sql.SQLException;
import java.util.List;

import web.common.dao.UserDao;
import web.common.entity.User;
/**
 * 
* 项目名称：ebs 
* @ClassName: UserDaoImpl
* @author ZK JIA<br>
* 创建时间： 2013-11-9 下午02:27:30<br>
* @version 1.1<br>
* 描述: TODO(这里用一句话描述这个类的作用)<br>
 */
public class UserDaoImpl extends BaseDaoImpl implements UserDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<User> getAllUser() throws SQLException {
		
		return getSqlMapClient().queryForList("userSpace.getAllUser");
	}

	/* (non-Javadoc)
	 * @see web.common.dao.UserDao#addUser(web.common.entity.User)
	 */
	@Override
	public void addUser(User user) throws SQLException {
		getSqlMapClient().update("userSpace.addUser", user);
		
	}

	/* (non-Javadoc)
	 * @see web.common.dao.UserDao#getUserByUserCode(java.lang.String)
	 */
	@Override
	public User getUserByUserCode(String userCode) throws SQLException {
		
		return (User) getSqlMapClient().queryForObject("userSpace.getUserByUserCode", userCode);
	}

	/* (non-Javadoc)
	 * @see web.common.dao.UserDao#getUserByUserParameters(web.common.entity.User)
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<User> getUserByUserParameters(User user) throws SQLException {
		// TODO Auto-generated method stub
		return getSqlMapClient().queryForList("userSpace.getUserByUserCode", user);
	}

	/* (non-Javadoc)
	 * @see web.common.dao.UserDao#updateUserByParameters(web.common.entity.User)
	 */
	@Override
	public void updateUserByParameters(User user) throws SQLException {
		getSqlMapClient().update("userSpace.updateUserByParameters", user);
	}

}
